<?php if(!defined('IN_PISCES')){exit('Access Denied.');}?>
<script language="javascript" src="{$this->data['baseurl']}js/jquery/jquery.js"></script>
<script language="javascript" src="{$this->data['baseurl']}js/jquery/form.js"></script>
<script language="javascript" src="{$this->data['baseurl']}js/utils.js"></script>
<script type="text/javascript">
var successFun=function(res){
if(res.code==200){
	document.location	= res.data.forward;
}else{
	//alert('出错了，请重新尝试！');
}
}
$(document).ready(function() { 
	var updateOptions	= {dataType:'json',error:doError,success:doSuccess}
    $('#form').ajaxForm(updateOptions); 
}); 
</script>

<div class="nav mb5">
您的位置：
<a href="{$this->data['baseurl']}">{$this->data['site']['site_name']}</a>
 > <a href="{url('Post', 'List')}">购物讨论</a>
 > 发表帖子
</div>
<div class="post-body">
<div class="post-form">
<form id="form" action="{url('Post','SaveEdit')}" method="post">
<table class="post-table">
	<tr>
	<th class="post-td">帖子标题：</td>
	<td class="post-td"><input type="text" name="title" size="80" {if $this->data['info']}value="{$this->data['info']['title']}"{/if} /><span etype='error_info' class="error_info" id="title_info"></span></td>
	</tr>
	<tr>
	<th class="post-td">帖子内容：</td>
	<td class="post-td">
	<textarea name="content#content" id="txtcontent" style="width:600px;height:300px">
	{if $this->data['info']}{$this->data['info']['content']['content']}{/if}
	</textarea>
	<span etype='error_info' class="error_info" id="content#content_info"></span>
	</td>
	</tr>
	<tr>
	<th class="post-td">添加标签：</td>
	<td class="post-td">
	<input name="tag" type="text" size="60" {if $this->data['info']}value="{$this->data['info']['tag']}"{/if} /><span etype='error_info' class="error_info" id="tag_info">多个标签之间用，分隔</span>
	</td>
	</tr>
	<tr><td></td><td class="post-td"><input id="btnAjaxSubmit" type="submit" value="保存" /><input name="id" type="hidden" value="{$this->data['info']['id']}" /></td></tr>
</table>
</form>
</div>
</div>
<script src="{$this->data['baseurl']}js/editor/kindeditor/kindeditor.js"></script>
<script>
KE.show({
id : 'txtcontent',
allowUpload : false
});
</script>
